namespace DailyPoetryH.Library.Models;

public class QueryFilterType {
    public static readonly QueryFilterType NameFilter =
        new("标题", nameof(Poetry.Name));

    public static readonly QueryFilterType AuthorNameFilter =
        new("作者", nameof(Poetry.Author));

    public static readonly QueryFilterType ContentFilter =
        new("内容", nameof(Poetry.Content));

    public static IEnumerable<QueryFilterType> FilterTypes { get; } =
        new List<QueryFilterType> {
            NameFilter, AuthorNameFilter, ContentFilter
        };

    public QueryFilterType(string name, string propertyName) {
        Name = name;
        PropertyName = propertyName;
    }

    public string Name { get; }

    public string PropertyName { get; }
}